import java.util.HashSet;
import java.util.Random;
import java.util.Set;
public class v3 {
    public static final int PROBLEMS_PER_LINE = 5;
    private static final int PROBLEM_WIDTH = 20;
    private static final int TOTAL_PROBLEMS = 50;
    private static final int MAX_OPERAND = 100;
    public static void main(String[] args) {
        Random random = new Random();
        Set<String> uniqueProblems = generateUniqueProblems(random, TOTAL_PROBLEMS);
        printProblems(uniqueProblems);
    }
    static Set<String> generateUniqueProblems(Random random, int totalProblems) {
        Set<String> uniqueProblems = new HashSet<>();
        while (uniqueProblems.size() < totalProblems) {
            uniqueProblems.add(generateProblem(random));
        }
        return uniqueProblems;
    }
    private static String generateProblem(Random random) {
        int operand1 = random.nextInt(MAX_OPERAND + 1);
        int operand2 = random.nextInt(MAX_OPERAND + 1);
        String problem;
        if (random.nextBoolean()) {
            // 加法算式，确保和不超过100
            operand2 = Math.min(operand2, MAX_OPERAND - operand1);
            problem = String.format("%d + %d = %d", operand1, operand2, operand1 + operand2);
        } else {
            // 减法算式，确保差不小于0
            operand1 = Math.max(operand1, operand2);
            operand2 = Math.min(operand1, operand2);
            problem = String.format("%d - %d = %d", operand1, operand2, operand1 - operand2);
        }
        return problem;
    }
    static void printProblems(Set<String> uniqueProblems) {
        int count = 0;
        int startNumber = 1;
        for (String problem : uniqueProblems) {
            if (count % PROBLEMS_PER_LINE == 0) {
                System.out.printf("%2d-%2d: ", startNumber, startNumber + PROBLEMS_PER_LINE - 1);
            }
            System.out.printf("%" + PROBLEM_WIDTH + "s", problem);
            if ((count + 1) % PROBLEMS_PER_LINE == 0) {
                System.out.println();
            }
            count++;
            startNumber++;
        }
        if (count % PROBLEMS_PER_LINE != 0) {
            System.out.println();
        }
    }
}